package com.book.controller;


import com.book.model.TAuthor;
import com.book.service.TAuthorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wx
 * @since 2023-10-13 10:49:13
 */
@RestController
@RequestMapping("/tAuthor")
public class TAuthorController {

    @Autowired
    private TAuthorService tAuthorService;
    @RequestMapping("getAllAuthor")
    public List<TAuthor> getAllAuthor(){
       return tAuthorService.getAllAuthor();
    }
    @PostMapping("addAuthor")
    public void addAuthor(TAuthor tAuthor){
        tAuthorService.addAuthou(tAuthor);
    }
    @DeleteMapping("deleteAuthor")
    public void deleteAuthor(Long id){
        tAuthorService.deleteAuthor(id);
    }
    @PutMapping("updateAuthor")
    public void updateAuthor(TAuthor tAuthor){
        tAuthorService.updateAuthor(tAuthor);
    }
}
